<%@ page import="ghr.day0109.travelt.dao.ScenicDao" %>
<%@ page import="ghr.day0109.travelt.dao.impl.ScenicDaoImpl" %>
<%@ page import="ghr.day0109.travelt.entity.ScenicSpot" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: Gong
  Date: 2023/1/9
  Time: 19:53
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <meta charset="utf-8">
    <title>添加</title>
    <link rel="stylesheet" href="../../../css/ghr/travelt/add.css" type="text/css">
    <script src="../../../js/ghr/travelt/jquery-3.6.3.js" type="text/javascript"></script>
    <script src="../../../js/ghr/travelt/add.js" type="text/javascript"></script>
    <%
        ScenicDao scenicDao = new ScenicDaoImpl();
        List<ScenicSpot> spots = scenicDao.queryAllScenic();
        request.setAttribute("scenic",spots);
    %>
</head>
<body>
<div>
    <div id="A">
        <strong>添加旅游路线信息</strong>
    </div>
    <div>
        <br><br>
        <form action="addControl.jsp" method="post">
        <table id="table">
            <tr>
                <td><span>旅游路线名称*：</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
                <td><input type="text" name="name" id="name"><br></td>
            </tr>
            <tr>
                <td><span>类型*：</span></td>
                <td>
                    <input type="radio" name="type"  value="1">自由行
                    <input type="radio" name="type"  value="2" ><span>纯玩团</span>
                </td>
            </tr>
            <tr>
                <td><span>价格*：</span></td>
                <td><input type="text" name="price"></td>
            </tr>
            <tr>
                <td><span>包含景点*：</span></td>
                <td><div class="cont">
                    <c:forEach items="${scenic}" var="s">

                    <input  type="checkbox"  value="${s.ssId}" name="check">
                        ${s.ssName}
                   </c:forEach>
                    <input type="hidden" name="s" id="s">
                </div></td>
            </tr>
            <tr>
                <td><span>咨询人*：</span></td>
                <td><input type="text" name="user"></td>
            </tr>
            <tr>
                <td><span>咨询电话*：</span></td>
                <td><input type="text" name="phone"></td>
            </tr>
        </table>

        <div id="button">
            <br>
            <button id="add" class="btn" onclick="location.href='addControl.jsp'" type="submit">添加</button>&nbsp;&nbsp;&nbsp;&nbsp;
            <button id ="back" onclick="location.href='http://localhost:8080/java_web_2023_01_09/ab'" class="btn" type="button">返回</button>
        </div>
        </form>
    </div>
</div>
</body>
</html>
